<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<script>
//首尾节点
//firstChild  firstElementChild
//lastChild   lastElementChild

/*	window.onload=function(){
		var ul=document.getElementById('ul');
		//IE
		//ul.firstChild.style.background='red';	
		//FF
		//ul.firstElementChild.style.background='red';	
		
		var oFirst=ul.firstElementChild||ul.firstChild;
		oFirst.style.background='green';
	};
*/	
//兄弟节点
//nextSibling   nextElementSibling
//previousSibling   previousElementSibling

window.onload=function(){
	var li=document.getElementById('li1');
	li.previousSibling.style.background='red';	
	
	
};
</script>
</head>

<body>
<ul id="ul">
	<li></li>
	<li></li>
	<li id="li1">111</li>
	<li></li>
	<li></li>
</ul>
</body>
</html>
